package com.woyou.ui.activity.orderdetail;

import com.woyou.ui.api.Command;

/**
 * 返回按钮命令工厂
 * @author longtao.li
 *
 */
public class BackCommandFactory {
	
	public static Command createBackCommand(ViewControl view, int state){
		Command command  = null;
		switch (state) {
		case State.CONFIRMED:
			// 订单已确认
			command = new ConfirmedBackCommand(view);
			break;
			
		case State.SENT_OUT:
			// 订单已送出
			command = new ConfirmedBackCommand(view);
			break;
	     
		case State.DELICERED:
			// 订单已送达
			command = new AssessmentBackCommand(view);
			break;
			
		case State.COMMENTED:
			//订单已评价
			command = new AssessmentBackCommand(view);
			break;
			
		case State.AUTO_COMPLETE:
			// 订单自动完成
			command = new AssessmentBackCommand(view);
			break;
			
		case State.CANCELLATION:
			// 申请取消中
			command = new CancelingBackCommand(view);
			break;
			
		case State.NEW_ORDER_ONLINEPAY:
			// 待支付
			command = new NoPayCanceledBackCommand(view);
			break;

		default:
			break;
		}
		
		return command;
		
	}

}
